<?php
/**
 * @file 001.php
 * @package 
 * @subpackage 
 * @version $id: 0.1 utf8 2009/ / : : $
 * @author LD King <kldscs@gmail.com>
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 * @desc 
 */

$dbh = new mysqli('localhost', 'LD', 'LD', 'test');
if($dbh->connect_error){
    die('Connect Error: '.$dbh->connect_errno);
}

$sql1 = "insert into test1 value(1, 't11'),(2,'t22');";
$sql2 = "insert into test2 value(3, 'nqq'),(4,'npp');";

var_dump( $dbh->query($sql1) );
echo $dbh->errno;

try{
      //$dbh->autocommit(FALSE);
    $dbh->query("begin;");
    //$dbh->query($sql2);
    $dbh->query($sql1);
  $dbh->query("commit;");
//$dbh->query("rollback;");
echo "Coomit!!!-------{$dbh->error}";

}catch(Exception $e){
    $dbh->query("roolback;");
    echo "RoolBACK!!!----{$dbh->error}";
}


$dbh->close();
?>

